//
//  ZWTestNetController.swift
//  SwiftFreshBeen
//
//  Created by Apple on 16/12/23.
//  Copyright © 2016年 zhouwnegang. All rights reserved.
//

import UIKit
import YYModel

class ZWTestNetController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        getHomeData()
       
    }
    
    //获取首页数据
    func getHomeData() {
        
        let urlString = "http://iosapi.itcast.cn/loveBeen/focus.json.php"
        
        
        let parameter:[String:Any] = ["call":1]
        HMNetworkingTools.shared.request(method: .POST, URLString: urlString, parameters: parameter) { (respondObject, error) in
            
            if error != nil  {
                
                print("数据请求失败")
                return
                
            }
            
            //数据请求成功
            let respondDict = try? JSONSerialization.jsonObject(with: respondObject as! Data , options: JSONSerialization.ReadingOptions.allowFragments) as! [String:Any]
        
            print(">>%@",respondDict ?? "" )
            
            
        }

    }
   
}
